package com.du.linandroid.biz;

import android.content.Context;

import com.sina.weibo.sdk.auth.sso.SsoHandler;
import com.tencent.mm.opensdk.openapi.IWXAPI;
import com.tencent.mm.opensdk.openapi.WXAPIFactory;
import com.tencent.tauth.Tencent;

/**
 * Created by DuZiLin on 2018/3/29.
 */

public class ApiHolder {
    public static String WX_APP_ID = "";
    public static String WX_SECRET = "";
    public static String QQ_APP_ID = "";
    public static String QQ_SECRET = "";
    public static String WEIBO_APP_KEY = "";
    protected static IWXAPI mWxApi;
    private static Context mContext;
    protected static Tencent mTencent;
    protected static SsoHandler mSsoHandler;
    public static void wechatInit(Context context) {
        mContext = context;
        regToWx();
    }
    public static void qqInit(Context context) {
        mTencent = Tencent.createInstance(QQ_APP_ID, context.getApplicationContext());
    }

    private static void regToWx() {
        mWxApi = WXAPIFactory.createWXAPI(mContext.getApplicationContext(), WX_APP_ID, true);
        mWxApi.registerApp(WX_APP_ID);
    }
}
